package com.ces.knacky.model;

import java.io.Serializable;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;

import com.ces.knacky.framework.model.AbstractParentEntity;

/** @author Hibernate CodeGenerator */
public class Address extends AbstractParentEntity implements Serializable {

    /** persistent field */
    private int contactNumber;

    /** persistent field */
    private com.ces.knacky.model.LocationTable location;

    /** persistent field */
    private com.ces.knacky.model.AddressType addressType;

    /** persistent field */
    private Set companyAddresses;

    /** persistent field */
    private Set userAddresses;

    /** full constructor */
    public Address(int contactNumber, com.ces.knacky.model.LocationTable location, com.ces.knacky.model.Flag flag, com.ces.knacky.model.AddressType addressType, Set companyAddresses, Set userAddresses) {
        this.contactNumber = contactNumber;
        this.location = location;
        this.flag = flag;
        this.addressType = addressType;
        this.companyAddresses = companyAddresses;
        this.userAddresses = userAddresses;
    }

    /** default constructor */
    public Address() {
    }

   public int getContactNumber() {
        return this.contactNumber;
    }

    public void setContactNumber(int contactNumber) {
        this.contactNumber = contactNumber;
    }

    public com.ces.knacky.model.LocationTable getLocation() {
        return this.location;
    }

    public void setLocation(com.ces.knacky.model.LocationTable location) {
        this.location = location;
    }

    public com.ces.knacky.model.AddressType getAddressType() {
        return this.addressType;
    }

    public void setAddressType(com.ces.knacky.model.AddressType addressType) {
        this.addressType = addressType;
    }

    public Set getCompanyAddresses() {
        return this.companyAddresses;
    }

    public void setCompanyAddresses(Set companyAddresses) {
        this.companyAddresses = companyAddresses;
    }

    public Set getUserAddresses() {
        return this.userAddresses;
    }

    public void setUserAddresses(Set userAddresses) {
        this.userAddresses = userAddresses;
    }

    public boolean equals(Object other) {
        if ( !(other instanceof Address) ) return false;
        Address castOther = (Address) other;
        return new EqualsBuilder()
            .append(this.getId(), castOther.getId())
            .isEquals();
    }

}
